package com.lysj.admin.gateway.controller;

import com.lysj.admin.utils.annotation.SystemLog;
import com.lysj.admin.utils.web.Resp;
import com.netflix.zuul.context.RequestContext;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Created by zk on 2019-01-16 20:02
 * @description
 */
@RestController
public class ErrorHandlerController implements ErrorController{

    @RequestMapping("/error")
    public Resp error(){
//        RequestContext ctx = RequestContext.getCurrentContext();
//        Throwable throwable = ctx.getThrowable();
        return new Resp().error(Resp.Status.INNER_ERROR,"oops!");
    }

    @Override
    public String getErrorPath() {
        return "/error";
    }
}
